<template>
  <el-scrollbar class="components-attr-edit">
    <div class="attr-edit-inner"
         v-if="activeElementUUID">
      <el-form>
        <qkImageAttr v-if="activeElement.elName=='qk-image'"
                     class="element-on-edit-pane"
                     :prop="activeElement.propsValue.prop">
        </qkImageAttr>
        <qkInputAttr v-if="activeElement.elName=='qk-input'"
                     class="element-on-edit-pane"
                     :prop="activeElement.propsValue.prop">
        </qkInputAttr>
        <qkGoodsAttr v-if="activeElement.elName=='qk-goods'"
                     class="element-on-edit-pane"
                     :prop="activeElement.propsValue.prop">
        </qkGoodsAttr>
        <qkStoreHeaderAttr v-if="activeElement.elName=='qk-store-header'"
                           class="element-on-edit-pane"
                           :prop="activeElement.propsValue.prop">
        </qkStoreHeaderAttr>
        <qkStoreGoodsAttr v-if="activeElement.elName=='qk-store-goods'"
                          class="element-on-edit-pane"
                          :prop="activeElement.propsValue.prop">
        </qkStoreGoodsAttr>
         <qkAdvertAttr v-if="activeElement.elName=='qk-advert'"
                      class="element-on-edit-pane"
                      :prop="activeElement.propsValue.prop">
         </qkAdvertAttr>
        <qkTabbarAttr v-if="activeElement.elName=='qk-tabbar'"
                      class="element-on-edit-pane"
                      :prop="activeElement.propsValue.prop">
        </qkTabbarAttr>
        <qkCarouselAttr v-if="activeElement.elName=='qk-carousel'"
                        class="element-on-edit-pane"
                        :prop="activeElement.propsValue.prop">
        </qkCarouselAttr>
        <qkStoreHotGoodsAttr v-if="activeElement.elName=='qk-store-hot-goods'"
                             class="element-on-edit-pane"
                             :prop="activeElement.propsValue.prop">
        </qkStoreHotGoodsAttr>
        <qkStoreActivityAttr v-if="activeElement.elName=='qk-store-activity'"
                             class="element-on-edit-pane"
                             :prop="activeElement.propsValue.prop">
        </qkStoreActivityAttr>
        <qkStoreBannerAttr v-if="activeElement.elName=='qk-store-banner'"
                             class="element-on-edit-pane"
                             :prop="activeElement.propsValue.prop">
        </qkStoreBannerAttr>
        <qkStoreSearchAttr v-if="activeElement.elName=='qk-store-search'"
                           class="element-on-edit-pane"
                           :prop="activeElement.propsValue.prop">
        </qkStoreSearchAttr>
      </el-form>
    </div>
    <div v-else>
      <p class="gray paddingT30 text-center">请在画板上选择需要编辑得元素</p>
    </div>
  </el-scrollbar>
</template>

<script>
import { mapState, mapGetters } from 'vuex';
import { _qk_register_components_object_attr } from "../../plugins/index"
import QkStoreSearchAttr from "../../plugins/attr/qkStoreSearchAttr";

export default {
  props: {},
  components: {
    QkStoreSearchAttr,
    _qk_register_components_object_attr
  },
  computed: {
    ...mapState({
      activeElementUUID: state => state.editor.activeElementUUID
    }),
    ...mapGetters([
      'activeElement',
    ])
  },
}
</script>

<style scoped>
.components-attr-edit {
  height: 100%;
}

.attr-title {
  font-weight: bold;
}

.sizeAndPosition-wrapper {
  display: flex;
  width: 100%;
}
</style>
<style lang="scss">
.common-attr-style {
  .el-form-item {
    margin-bottom: 0;
  }
}
</style>
